namespace KYO.DAL {
    using System;
    using System.Text;
    using System.Collections;
    using System.Collections.Generic;
    
    public partial class Comment : ObjectPersistence.ORNetBaseType {
        public Comment() {
        }
        public Comment(string Content, System.Nullable<System.DateTime> DateCreate, string Email, int InformationId, string Name) {
            this.Content = Content;
            this.DateCreate = DateCreate;
            this.Email = Email;
            this.InformationId = InformationId;
            this.Name = Name;
        }
        public Comment(int CommentId, string Content, System.Nullable<System.DateTime> DateCreate, string Email, int InformationId, string Name) {
            this.CommentId = CommentId;
            this.Content = Content;
            this.DateCreate = DateCreate;
            this.Email = Email;
            this.InformationId = InformationId;
            this.Name = Name;
        }

        public int CommentId {
            get {
                return _CommentId;
            }
            set {
                this._CommentId = value;
                this.ChangesMade = true;
            }
        }
        public string Content {
            get {
                return _Content;
            }
            set {
                this._Content = value;
                this.ChangesMade = true;
            }
        }
        public System.Nullable<System.DateTime> DateCreate {
            get {
                return _DateCreate;
            }
            set {
                this._DateCreate = value;
                this.ChangesMade = true;
            }
        }
        public string Email {
            get {
                return _Email;
            }
            set {
                this._Email = value;
                this.ChangesMade = true;
            }
        }
        public int InformationId {
            get {
                return _InformationId;
            }
            set {
                this._InformationId = value;
                this.ChangesMade = true;
            }
        }
        public string Name {
            get {
                return _Name;
            }
            set {
                this._Name = value;
                this.ChangesMade = true;
            }
        }

        public KYO.DAL.Information InformationObject {
            get {
                if ((_InformationObject == null)) {
                    if (IsNew) {
                        _InformationObject = new KYO.DAL.Information();
                    }
                    else {
                        ObjectPersistence.CommentAssembler _tempAssem = new ObjectPersistence.CommentAssembler();
                        _InformationObject = _tempAssem.GetInformationObject(InformationId);
                    }
                }
                return _InformationObject;
            }
            set {
                if ((value == null)) {
                    throw new Exception("Error, this object cannot be set to null, since the FK properties which point to " +
                            "it are not nullable.");
                }
                else {
                    this.InformationId = value.InformationID;
                }
                this._InformationObject = value;
            }
        }



        private int _CommentId;
        private string _Content;
        private System.Nullable<System.DateTime> _DateCreate;
        private string _Email;
        private int _InformationId;
        private string _Name;
        private KYO.DAL.Information _InformationObject;


        public bool IsInformationObjectNull() {
            return (this._InformationObject == null);
        }
        public string ROKeyString {
            get {
                return ("KYO.DAL.Comment" + CommentId.ToString());
            }
        }

    }
}
